from common import *

def PrefixFunc(cin, prefixItem, cout):
    # Read prefix
    t = prefixItem()
    while 1:
        cout(t)
        t = cin()

